package com.example.Template;

public abstract class Game {
   abstract void initialize();
   abstract void startPlay();
   abstract void endPlay();

   public void clearPlayground() {
      System.out.println("[end] clearing Playground");
   }
 
   // 模板方法
   public final void play(){
      //初始化游戏
      initialize();
      //开始游戏
      startPlay();
      //结束游戏
      endPlay();

      clearPlayground();
   }
}
